import yaml
from addict import Dict
from pathlib import Path


def decode_config(cfg_file):
    with open(cfg_file, "r", encoding="utf-8") as f:
        cfg = yaml.load(f, Loader=yaml.FullLoader)
    cfg["case_name"] = Path(cfg_file).stem
    return EasyDict(cfg)
